import db from "@/lib/db";
import {NextRequest, NextResponse} from "next/server";


export const DELETE = async (_request:NextRequest,{params}:{params:Promise<{userId:string}>}) => {
  const {userId} = await params;
  try{
      await db.users.delete({
          where: {
              userId: parseInt(userId)
          }
      });
  }catch {
      return NextResponse.json({
          code: 500,
          msg:"系统异常"
      });
  }

    return NextResponse.json({
        code: 200,
        msg:"删除成功"
    })
}